package com.kude.manager;

import com.kude.dao.ArticleDAO;
import com.kude.entity.Article;

public class ArticleManager extends AbstractManager<Article, ArticleDAO> {

	ArticleDAO articleDAO;

	public ArticleManager() {
		this.tableName = Article.TABLE_NAME;
	}

	public boolean isExist(Article obj) throws OperException {
		if (obj == null) {
			throw new OperException("产品对象obj不能为空");
		}
		if (obj.getArticleId() == null) {
			return false;
		}
		if (dao.getById(obj.getArticleId()) == null) {
			return false;
		}
		return true;
	}

	public void setArticleDAO(ArticleDAO articleDAO) {
		this.dao = articleDAO;
	}

}
